package com.huitone.smspfm.dao.oracle;

import java.util.List;

import org.springframework.jdbc.core.BeanPropertyRowMapper;

import com.huitone.smspfm.dao.oracle.entity.GateAutoSwitch;


public class GateAutoSwitchDao extends BaseDao<GateAutoSwitch> {

	@Override
	public List<GateAutoSwitch> getAllObj() {
		return jdbcTemplate.query("SELECT * FROM " + tableName + " WHERE STATUS = '1'", new BeanPropertyRowMapper<GateAutoSwitch>(GateAutoSwitch.class));
	}

	
	public GateAutoSwitch getObject() {
		return jdbcTemplate.queryForObject("SELECT * FROM " + tableName + " WHERE STATUS = '1' "+ " AND ROWNUM <= 1 ", new BeanPropertyRowMapper<GateAutoSwitch>(GateAutoSwitch.class));
	}
}
